package com.vx.xmlModelToData.po;

import java.lang.reflect.Field;
import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.List;

//import javax.xml.bind.JAXBContext;
//import javax.xml.bind.JAXBException;
//import javax.xml.bind.Marshaller;
//import javax.xml.bind.annotation.XmlRootElement;

//@XmlRootElement(name = "root") 
public class FielsPO {
	private String name;
	private List<Validate> validate;
	private List<File> file;
//	private File fileA;
	
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public List<Validate> getValidate() {
		return validate;
	}
	public void setValidate(List<Validate> validate) {
		this.validate = validate;
	}
	public List<File> getFile() {
		return file;
	}
	public void setFile(List<File> file) {
		this.file = file;
	}
	
//	public File getFileA() {
//		return fileA;
//	}
//	public void setFileA(File fileA) {
//		this.fileA = fileA;
//	}
	
	
/*	public static void main(String[] args) throws JAXBException {
		Field[] f=FielsPO.class.getDeclaredFields();
		for (int i = 0; i < f.length; i++) {
//			f[i].setAccessible(true);
			if(f[i].getType().getName().equals("java.util.List")){
				Type c=f[i].getGenericType();
				Type[] t=((ParameterizedType)c).getActualTypeArguments();
				Class ty=(Class) t[0];
				System.out.println(ty.getName()+"--"+ty.getDeclaredFields().length);
			}
			System.out.println("name"+f[i].getName()+"---t:"+f[i].getType()+"---G:"+f[i].getGenericType());
		}
		System.out.println("---------------------");
		
		FielsPO po=new FielsPO();
		po.setName("王");
		List<Validate> vlist=new ArrayList<Validate>();
		vlist.add(new Validate("1", 0001, "fdsfsd", true));
		vlist.add(new Validate("2", 0002, "gf的", false));
		po.setValidate(vlist);
		List<File> fList=new ArrayList<File>();
		fList.add(new File("2a1bc0", "30", 7, "七天", "绝密"));
		fList.add(new File("2a1bc1", "32", 8, "八天", "机密"));
		po.setFile(fList);
		
		JAXBContext jbc=JAXBContext.newInstance(po.getClass());
		Marshaller mar=jbc.createMarshaller();
		mar.marshal(po, System.out);
		System.out.println();
	}*/
	
}
